package factory

type student struct {
	Name  string
	score float64
}

func NewStudent(name string, score float64) *student {
	return &student{
		Name:  name,
		score: score,
	}
}

// 也可以不返回指针
//func NewStudent(name string, score float64) student {
//	return student{
//		Name: name,
//		score: score,
//	}
//}

// 绑定方法GetScore(), 使得其他包可以调用score字段
func (s *student) GetScore() float64 {
	return s.score
}
